package com.isoft.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 消息元数据表-存储所有消息的公共头部
 * @TableName MSG_META
 */
@TableName(value ="MSG_META")
@Data
public class MsgMeta implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Long META_ID;

    /**
     * 消息发送者系统代码(FIMS/ORMS等)
     */
    private String SNDR;

    /**
     * 消息接收者系统代码(为空表示广播)
     */
    private String RCVR;

    /**
     * 消息序号(1-999999循环)
     */
    private Integer SEQN;

    /**
     * 消息发送时间(yyyyMMddHHmmss格式)
     */
    private Date DDTM;

    /**
     * 消息大类(DFOE/DFME/BASE/REQE/SIMG)
     */
    private String TYPE;

    /**
     * 子消息类型(DFIE/FPDL/HBTT等)
     */
    private String STYP;

    /**
     * 批量消息中的记录总数(0表示无数据)
     */
    private Integer RECD;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        MsgMeta other = (MsgMeta) that;
        return (this.getMETA_ID() == null ? other.getMETA_ID() == null : this.getMETA_ID().equals(other.getMETA_ID()))
                && (this.getSNDR() == null ? other.getSNDR() == null : this.getSNDR().equals(other.getSNDR()))
                && (this.getRCVR() == null ? other.getRCVR() == null : this.getRCVR().equals(other.getRCVR()))
                && (this.getSEQN() == null ? other.getSEQN() == null : this.getSEQN().equals(other.getSEQN()))
                && (this.getDDTM() == null ? other.getDDTM() == null : this.getDDTM().equals(other.getDDTM()))
                && (this.getTYPE() == null ? other.getTYPE() == null : this.getTYPE().equals(other.getTYPE()))
                && (this.getSTYP() == null ? other.getSTYP() == null : this.getSTYP().equals(other.getSTYP()))
                && (this.getRECD() == null ? other.getRECD() == null : this.getRECD().equals(other.getRECD()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getMETA_ID() == null) ? 0 : getMETA_ID().hashCode());
        result = prime * result + ((getSNDR() == null) ? 0 : getSNDR().hashCode());
        result = prime * result + ((getRCVR() == null) ? 0 : getRCVR().hashCode());
        result = prime * result + ((getSEQN() == null) ? 0 : getSEQN().hashCode());
        result = prime * result + ((getDDTM() == null) ? 0 : getDDTM().hashCode());
        result = prime * result + ((getTYPE() == null) ? 0 : getTYPE().hashCode());
        result = prime * result + ((getSTYP() == null) ? 0 : getSTYP().hashCode());
        result = prime * result + ((getRECD() == null) ? 0 : getRECD().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", META_ID=").append(META_ID);
        sb.append(", SNDR=").append(SNDR);
        sb.append(", RCVR=").append(RCVR);
        sb.append(", SEQN=").append(SEQN);
        sb.append(", DDTM=").append(DDTM);
        sb.append(", TYPE=").append(TYPE);
        sb.append(", STYP=").append(STYP);
        sb.append(", RECD=").append(RECD);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}